<!DOCTYPE html>
<html>
  <head>
    <title>换电站登录</title>
 
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
   
<#include "bases/global_style.ftl">
<#include "bases/global_js.ftl">

<link href="<@spring.url '/static/css/login.css'></@spring.url>" rel="stylesheet" type="text/css"/>
   
  </head>
  
  <body class="indexBody">
  	<div class="indexBox">
  		<div class="login-title">移动电网计费平台</div>
  		<form class="indexForm loginForm" id="loginForm" action="<@spring.url '/do_login'></@spring.url>" method="post">
  			<div class="index-title"></div>
			<div class="list-box">
				<div class="list-tr">
				 <#if loginname??>
					<input type="text" name="loginname" id="loginname" placeholder="登录名" value="${loginname}"/>
				 <#else>
				    <input type="text" name="loginname" id="loginname" placeholder="登录名"/>
				  </#if>
				</div>
				<div class="list-tr">
					<input type="password" name="passwords" id="passwords" placeholder="密码" />
				</div>
			</div>
			<div class="handle-bar">
				<div class="rememberPass"><input name="loginCheckbox1" id="loginCheckbox1" type="checkbox" value="" checked="checked"> 记住我</div>
			</div>
			
			<div class="foot-box btn1" id="loginSure">
				<a class="foot-butten a-white" href="javascript:;">登录</a>
			</div>
			
			<div class="error-resgister">
			    <#if alreadyLogin??><span id="errorContent">您的账号已在别处登录!</span></#if>
                <#if wrongpw??><span id="errorContent">输入的账号或密码错误，请重新输入账号和密码!</span></#if>
			</div>
			
  		</form>
  		<div>
  			<div class="copyrightPage">
  				<a class="a-white" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010602004862">
	  				<div class="copyright-imgBox">
	  					<img src="<@spring.url '/static/images/copyright.png'></@spring.url>"/>
					</div>浙公网安备 33010602004862号
  				</a>
  			</div>
  		</div>
  	</div>
 
       <div id="waiting" class="alert alert-info hide" role="alert">
           服务器正在处理您的请求，请稍候...
       </div>
       
  	<script type="text/javascript">
		$(document).ready(function(){
				loginSure();
			});
			
		function loginSure(){
			$("#loginSure").click(function(){
				var loginname=$("#loginname").val();
				var passwords=$("#passwords").val();
				
				if(loginname=="" || passwords==""){
					$(".error-resgister").css("display","block");
					$("#errorContent").text("您所填信息不完整！");
				}
				else{
					$("#errorContent").text("");
					$("#loginSure a").text("登录中...");
					$("#loginForm").submit();
				}
				
			});
		
		}
	    function saveStorage() {
	        // 如果勾选了复选框，则使用Local Storge保存数据
	        // 否则，用Session Storage保存数据
	        var checked = document.getElementById("loginCheckbox1").checked;
	        var storage = localStorage;
	        storage.setItem("loginname", document.getElementById('loginname').value);
	        storage.setItem("passwords", document.getElementById('passwords').value);
	    }
	    function rememberMe() {
	        var checked = document.getElementById("loginCheckbox1").checked;
	        var storage = localStorage;
	        if (checked) {
	            saveStorage();
	        } else {
	            storage.setItem("loginname", "");
	            storage.setItem("passwords", "");
	        }
	    }
	     
	</script>
  	
  </body>
</html>
